package org.nidy.erp.filter;

import jakarta.servlet.*;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
@Slf4j
// 过滤所有请求 拦截所有请求
//@WebFilter(urlPatterns = "/*")
public class NidyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
//        Filter.super.init(filterConfig);
        log.info("filter init... ...");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info("filter doFilter......");
        // 放行
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
//        Filter.super.destroy();
        log.info("filter destroy... ...");
    }
}
